# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MerchantAPI.Reports_v1beta.Model.NonProductPerformanceView do
  @moduledoc """
  Fields available for query in `non_product_performance_view` table. Performance data on images and online store links leading to your non-product pages. This includes performance metrics (for example, `clicks`) and dimensions according to which performance metrics are segmented (for example, `date`). Segment fields cannot be selected in queries without also selecting at least one metric field. Values are only set for fields requested explicitly in the request's search query.

  ## Attributes

  *   `clickThroughRate` (*type:* `float()`, *default:* `nil`) - Click-through rate - the number of clicks (`clicks`) divided by the number of impressions (`impressions`) of images and online store links leading to your non-product pages. Metric.
  *   `clicks` (*type:* `String.t`, *default:* `nil`) - Number of clicks on images and online store links leading to your non-product pages. Metric.
  *   `date` (*type:* `GoogleApi.MerchantAPI.Reports_v1beta.Model.Date.t`, *default:* `nil`) - Date in the merchant timezone to which metrics apply. Segment. Condition on `date` is required in the `WHERE` clause.
  *   `impressions` (*type:* `String.t`, *default:* `nil`) - Number of times images and online store links leading to your non-product pages were shown. Metric.
  *   `week` (*type:* `GoogleApi.MerchantAPI.Reports_v1beta.Model.Date.t`, *default:* `nil`) - First day of the week (Monday) of the metrics date in the merchant timezone. Segment.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :clickThroughRate => float() | nil,
          :clicks => String.t() | nil,
          :date => GoogleApi.MerchantAPI.Reports_v1beta.Model.Date.t() | nil,
          :impressions => String.t() | nil,
          :week => GoogleApi.MerchantAPI.Reports_v1beta.Model.Date.t() | nil
        }

  field(:clickThroughRate)
  field(:clicks)
  field(:date, as: GoogleApi.MerchantAPI.Reports_v1beta.Model.Date)
  field(:impressions)
  field(:week, as: GoogleApi.MerchantAPI.Reports_v1beta.Model.Date)
end

defimpl Poison.Decoder, for: GoogleApi.MerchantAPI.Reports_v1beta.Model.NonProductPerformanceView do
  def decode(value, options) do
    GoogleApi.MerchantAPI.Reports_v1beta.Model.NonProductPerformanceView.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MerchantAPI.Reports_v1beta.Model.NonProductPerformanceView do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
